# capture.py

from __future__ import division

from ot_simulator.component import component

class capture(component.component):
    '''This just captures the transformation.
    
    ===============  ==========================
     Input setting   
    ===============  ==========================
    <none>
    ===============  ==========================

    ===============  ==========================
    Output settings
    ===============  ==========================
    x, y, z          translation offsets
    ===============  ==========================

    Note: the ``x``, ``y`` and ``z`` output parameters can not be examined
    before :meth:`get_transform` is done.
    '''

    def get_transform(self, params, transform_in):
        x, y, z = transform_in.local_to_global()
        self.set_param(params, 'x', x)
        self.set_param(params, 'y', y)
        self.set_param(params, 'z', z)
        return transform_in


def test():
    import doctest
    import sys
    sys.exit(doctest.testmod()[0])

if __name__ == "__main__":
    test()
